3.642 \(\int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx\)

Optimal. Leaf size=93 \[ \frac{b (d \sec (e+f x))^m}{f m}-\frac{a d \sin (e+f x) (d \sec (e+f x))^{m-1} \, _2F_1\left (\frac{1}{2},\frac{1-m}{2};\frac{3-m}{2};\cos ^2(e+f x)\right )}{f (1-m) \sqrt{\sin ^2(e+f x)}} \]

[Out]

(b*(d*Sec[e + f*x])^m)/(f*m) - (a*d*Hypergeometric2F1[1/2, (1 - m)/2, (3 - m)/2, Cos[e + f*x]^2]*(d*Sec[e + f*
x])^(-1 + m)*Sin[e + f*x])/(f*(1 - m)*Sqrt[Sin[e + f*x]^2])

________________________________________________________________________________________

Rubi [A]  time = 0.0615625, antiderivative size = 93, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3486, 3772, 2643} \[ \frac{b (d \sec (e+f x))^m}{f m}-\frac{a d \sin (e+f x) (d \sec (e+f x))^{m-1} \, _2F_1\left (\frac{1}{2},\frac{1-m}{2};\frac{3-m}{2};\cos ^2(e+f x)\right )}{f (1-m) \sqrt{\sin ^2(e+f x)}} \]

Antiderivative was successfully verified.

[In]

Int[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x]),x]

[Out]

(b*(d*Sec[e + f*x])^m)/(f*m) - (a*d*Hypergeometric2F1[1/2, (1 - m)/2, (3 - m)/2, Cos[e + f*x]^2]*(d*Sec[e + f*
x])^(-1 + m)*Sin[e + f*x])/(f*(1 - m)*Sqrt[Sin[e + f*x]^2])

Rule 3486

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*(d*Sec[
e + f*x])^m)/(f*m), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3772

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x])^(n - 1)*((Sin[c + d*x]/b)^(n - 1)
*Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rubi steps

\begin{align*} \int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx &=\frac{b (d \sec (e+f x))^m}{f m}+a \int (d \sec (e+f x))^m \, dx\\ &=\frac{b (d \sec (e+f x))^m}{f m}+\left (a \left (\frac{\cos (e+f x)}{d}\right )^m (d \sec (e+f x))^m\right ) \int \left (\frac{\cos (e+f x)}{d}\right )^{-m} \, dx\\ &=\frac{b (d \sec (e+f x))^m}{f m}-\frac{a \cos (e+f x) \, _2F_1\left (\frac{1}{2},\frac{1-m}{2};\frac{3-m}{2};\cos ^2(e+f x)\right ) (d \sec (e+f x))^m \sin (e+f x)}{f (1-m) \sqrt{\sin ^2(e+f x)}}\\ \end{align*}

Mathematica [C]  time = 16.8281, size = 3302, normalized size = 35.51 \[ \text{Result too large to show} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x]),x]

[Out]

-((Sec[e + f*x]^(-1 - m)*(d*Sec[e + f*x])^m*(Cos[(e + f*x)/2]^2*Sec[e + f*x])^m*(a*Sec[e + f*x]^m + b*Sec[e +
f*x]^(1 + m)*Sin[e + f*x])*Tan[(e + f*x)/2]*(-(b*AppellF1[1, m, 1 - m, 2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2
]^2]*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^m*Tan[(e + f*x)/2]) - b*AppellF1[1, 1 + m, -m, 2, Tan[(e + f*x)/2]^2, -
Tan[(e + f*x)/2]^2]*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^m*Tan[(e + f*x)/2] - (6*a*AppellF1[1/2, m, 1 - m, 3/2, T
an[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Sec[(e + f*x)/2]^2)^(-1 + m))/(3*AppellF1[1/2, m, 1 - m, 3/2, Tan[(e
+ f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 2*((-1 + m)*AppellF1[3/2, m, 2 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x
)/2]^2] + m*AppellF1[3/2, 1 + m, 1 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2))*(a
 + b*Tan[e + f*x]))/(f*(a*Cos[e + f*x] + b*Sin[e + f*x])*(-(Sec[(e + f*x)/2]^2*(Cos[(e + f*x)/2]^2*Sec[e + f*x
])^m*(-(b*AppellF1[1, m, 1 - m, 2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^
m*Tan[(e + f*x)/2]) - b*AppellF1[1, 1 + m, -m, 2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Cos[e + f*x]*Sec[(
e + f*x)/2]^2)^m*Tan[(e + f*x)/2] - (6*a*AppellF1[1/2, m, 1 - m, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]
*(Sec[(e + f*x)/2]^2)^(-1 + m))/(3*AppellF1[1/2, m, 1 - m, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 2*(
(-1 + m)*AppellF1[3/2, m, 2 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + m*AppellF1[3/2, 1 + m, 1 - m,
 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2)))/2 - (Cos[(e + f*x)/2]^2*Sec[e + f*x])^m*
Tan[(e + f*x)/2]*(-(b*AppellF1[1, m, 1 - m, 2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*(Co
s[e + f*x]*Sec[(e + f*x)/2]^2)^m)/2 - (b*AppellF1[1, 1 + m, -m, 2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Se
c[(e + f*x)/2]^2*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^m)/2 - b*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^m*Tan[(e + f*x)/
2]*(-((1 - m)*AppellF1[2, m, 2 - m, 3, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*
x)/2])/2 + (m*AppellF1[2, 1 + m, 1 - m, 3, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e
+ f*x)/2])/2) - b*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^m*Tan[(e + f*x)/2]*((m*AppellF1[2, 1 + m, 1 - m, 3, Tan[(e
 + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2])/2 + ((1 + m)*AppellF1[2, 2 + m, -m, 3,
 Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2])/2) - b*m*AppellF1[1, m, 1 - m,
2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^(-1 + m)*Tan[(e + f*x)/2]*(-(Sec
[(e + f*x)/2]^2*Sin[e + f*x]) + Cos[e + f*x]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2]) - b*m*AppellF1[1, 1 + m, -m,
 2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^(-1 + m)*Tan[(e + f*x)/2]*(-(Se
c[(e + f*x)/2]^2*Sin[e + f*x]) + Cos[e + f*x]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2]) - (6*a*(-1 + m)*AppellF1[1/
2, m, 1 - m, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Sec[(e + f*x)/2]^2)^(-1 + m)*Tan[(e + f*x)/2])/(3*
AppellF1[1/2, m, 1 - m, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 2*((-1 + m)*AppellF1[3/2, m, 2 - m, 5/
2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + m*AppellF1[3/2, 1 + m, 1 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e +
 f*x)/2]^2])*Tan[(e + f*x)/2]^2) - (6*a*(Sec[(e + f*x)/2]^2)^(-1 + m)*(-((1 - m)*AppellF1[3/2, m, 2 - m, 5/2,
Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2])/3 + (m*AppellF1[3/2, 1 + m, 1 -
m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2])/3))/(3*AppellF1[1/2, m,
1 - m, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 2*((-1 + m)*AppellF1[3/2, m, 2 - m, 5/2, Tan[(e + f*x)/
2]^2, -Tan[(e + f*x)/2]^2] + m*AppellF1[3/2, 1 + m, 1 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[
(e + f*x)/2]^2) + (6*a*AppellF1[1/2, m, 1 - m, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Sec[(e + f*x)/2]
^2)^(-1 + m)*(2*((-1 + m)*AppellF1[3/2, m, 2 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + m*AppellF1[3
/2, 1 + m, 1 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2] + 3*(-((1
 - m)*AppellF1[3/2, m, 2 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2
])/3 + (m*AppellF1[3/2, 1 + m, 1 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e
+ f*x)/2])/3) + 2*Tan[(e + f*x)/2]^2*((-1 + m)*((-3*(2 - m)*AppellF1[5/2, m, 3 - m, 7/2, Tan[(e + f*x)/2]^2, -
Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2])/5 + (3*m*AppellF1[5/2, 1 + m, 2 - m, 7/2, Tan[(e + f*
x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2])/5) + m*((-3*(1 - m)*AppellF1[5/2, 1 + m, 2
- m, 7/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2])/5 + (3*(1 + m)*AppellF
1[5/2, 2 + m, 1 - m, 7/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2])/5))))/
(3*AppellF1[1/2, m, 1 - m, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 2*((-1 + m)*AppellF1[3/2, m, 2 - m,
 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + m*AppellF1[3/2, 1 + m, 1 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(
e + f*x)/2]^2])*Tan[(e + f*x)/2]^2)^2) - m*(Cos[(e + f*x)/2]^2*Sec[e + f*x])^(-1 + m)*Tan[(e + f*x)/2]*(-(b*Ap
pellF1[1, m, 1 - m, 2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^m*Tan[(e + f
*x)/2]) - b*AppellF1[1, 1 + m, -m, 2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Cos[e + f*x]*Sec[(e + f*x)/2]^
2)^m*Tan[(e + f*x)/2] - (6*a*AppellF1[1/2, m, 1 - m, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*(Sec[(e + f
*x)/2]^2)^(-1 + m))/(3*AppellF1[1/2, m, 1 - m, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 2*((-1 + m)*App
ellF1[3/2, m, 2 - m, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + m*AppellF1[3/2, 1 + m, 1 - m, 5/2, Tan[(e
 + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2))*(-(Cos[(e + f*x)/2]*Sec[e + f*x]*Sin[(e + f*x)/2]) +
Cos[(e + f*x)/2]^2*Sec[e + f*x]*Tan[e + f*x]))))

________________________________________________________________________________________

Maple [F]  time = 0.501, size = 0, normalized size = 0. \begin{align*} \int \left ( d\sec \left ( fx+e \right ) \right ) ^{m} \left ( a+b\tan \left ( fx+e \right ) \right ) \, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x)

[Out]

int((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (f x + e\right ) + a\right )} \left (d \sec \left (f x + e\right )\right )^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x, algorithm="maxima")

[Out]

integrate((b*tan(f*x + e) + a)*(d*sec(f*x + e))^m, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (b \tan \left (f x + e\right ) + a\right )} \left (d \sec \left (f x + e\right )\right )^{m}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x, algorithm="fricas")

[Out]

integral((b*tan(f*x + e) + a)*(d*sec(f*x + e))^m, x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (d \sec{\left (e + f x \right )}\right )^{m} \left (a + b \tan{\left (e + f x \right )}\right )\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))**m*(a+b*tan(f*x+e)),x)

[Out]

Integral((d*sec(e + f*x))**m*(a + b*tan(e + f*x)), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (f x + e\right ) + a\right )} \left (d \sec \left (f x + e\right )\right )^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate((b*tan(f*x + e) + a)*(d*sec(f*x + e))^m, x)